<template>
  <div class="overview">
    <card title="关于">
      <div class="c-left">
        此 Vue3 Project 是基于 Vue3、Vuex、VueRouter、VueCli、 ElementPlus
        、TypeScript、Echart5 等技术开发的后台管理系统。
      </div>
    </card>
    <card title="技术栈">
      <text-link :text-arrs="technologyStacks"></text-link>
      <descriptions
        title="生产环境依赖"
        :column="2"
        :tableDatas="dependencies"
      ></descriptions>
      <descriptions
        title="开发环境依赖"
        :column="2"
        :tableDatas="devDependencies"
      ></descriptions>
    </card>
    <card title="项目结构">
      <s-code language="bash" :code="projectDir"></s-code>
    </card>
    <card title="项目规范">
      <descriptions
        title="文件命名规范"
        :column="1"
        :table-datas="normDoc"
      ></descriptions>
      <descriptions
        title="编写组件规范"
        :column="1"
        :table-datas="normCpn"
      ></descriptions>
    </card>
    <card title="Git提交规范">
      <descriptions :column="1" :table-datas="normGit"></descriptions>
    </card>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'

import {
  technologyStacks,
  devDependencies,
  dependencies,
  projectDir,
  normCpn,
  normDoc,
  normGit
} from './config'

import Card from '@/base-ui/card'
import TextLink from '@/base-ui/text-link'
import Descriptions from '@/base-ui/descriptions'
import SCode from '@/base-ui/code'

export default defineComponent({
  name: 'overview',
  components: {
    Card,
    TextLink,
    Descriptions,
    SCode
  },
  setup() {
    return {
      technologyStacks,
      devDependencies,
      dependencies,
      projectDir,
      normCpn,
      normDoc,
      normGit
    }
  }
})
</script>

<style scoped lang="less">
.overview {
  .c-left {
    text-align: left;
  }

  .el-card {
    margin-bottom: 20px;
    // ::v-deep 重写 element-plus 样式
    &:deep(.el-card__header span) {
      // ::v-deep .el-card__header span {
      font-weight: 700;
    }
  }

  .description {
    // ::v-deep 重写 element-plus 样式
    &:deep(.el-descriptions__title) {
      // ::v-deep .el-descriptions__title {
      font-weight: 400;
    }
  }
}
</style>
